import { http } from '@/utils/http'
import type { LoginResult } from '@/types/member'

/**
 * 请求参数
 */
export type LoginParams = {
  code: string
  encryptedData: string
  iv: string
}

/**
 * 小程序登录
 * @param data 请求参数
 */
export const postLoginWxMin = (data: LoginParams) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/sso/login/wxMin',
    data,
  })
}

/**
 * 小程序登录-内测版
 * @param username 模拟手机号码
 * @param password 密码
 */
export const postLoginWxMinSimpleAPI = (username: string, password: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: `/sso/login?username=${username}&password=${password}`,
  })
}


